#include "hal_gpio.h"
#include "gpio.h"


static void valve_gpio_config(void)
{
	stc_gpio_cfg_t config;
    config.enDir = GpioDirOut;
    config.enPu  = GpioPuDisable;
    config.enPd  = GpioPdDisable;   
    Gpio_ClrIO(VALVE_CTRL_PORT, VALVE_CTRL_PIN);
    Gpio_Init(VALVE_CTRL_PORT, VALVE_CTRL_PIN, &config);
}

static void heater_gpio_config(void)
{
	stc_gpio_cfg_t config;
    config.enDir = GpioDirOut;
    config.enPu = GpioPuDisable;
    config.enPd = GpioPdDisable;
    Gpio_ClrIO(HEATER_CTRL_PORT, HEATER_CTRL_PIN);
    Gpio_Init(HEATER_CTRL_PORT, HEATER_CTRL_PIN, &config);
}

static void button_led_gpio_config(void)
{
	stc_gpio_cfg_t config;
    config.enDir = GpioDirOut;
    config.enPu = GpioPuDisable;
    config.enPd = GpioPdDisable;
    Gpio_ClrIO(BUTTON_LED_CTRL_PORT, BUTTON_LED_CTRL_PIN);
    Gpio_Init(BUTTON_LED_CTRL_PORT, BUTTON_LED_CTRL_PIN, &config);
}


void hal_goio_init(void)
{
	Sysctrl_SetPeripheralGate(SysctrlPeripheralGpio, TRUE); // 打开 IO 时钟	
	heater_gpio_config();
	valve_gpio_config();
	button_led_gpio_config();
}

